package com.timesheet.gui.efforttracker.composite;

import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.TableViewerColumn;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;

import com.timesheet.gui.efforttracker.controllers.DetailedUtilisationCompositeController;

public class DetailedUtilisationComposite extends Composite {
	private Table table;
	private TableViewer tableViewer;

	/**
	 * Create the composite.
	 * @param parent
	 * @param style
	 */
	public DetailedUtilisationComposite(Composite parent, int style) {
		super(parent, style);
		setLayout(new GridLayout(1, false));
		
		tableViewer = new TableViewer(this, SWT.BORDER | SWT.FULL_SELECTION);
		table = tableViewer.getTable();
		table.setLinesVisible(true);
		table.setHeaderVisible(true);
		table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
		
		TableViewerColumn tableViewerColumn = new TableViewerColumn(tableViewer, SWT.NONE);
		TableColumn tblclmnDay = tableViewerColumn.getColumn();
		tblclmnDay.setWidth(100);
		tblclmnDay.setText("Day");
		
		TableViewerColumn tableViewerColumn_2 = new TableViewerColumn(tableViewer, SWT.NONE);
		TableColumn tblclmnTaskno = tableViewerColumn_2.getColumn();
		tblclmnTaskno.setWidth(100);
		tblclmnTaskno.setText("Taskno");
		
		TableViewerColumn tableViewerColumn_1 = new TableViewerColumn(tableViewer, SWT.NONE);
		TableColumn tblclmnHours = tableViewerColumn_1.getColumn();
		tblclmnHours.setWidth(100);
		tblclmnHours.setText("Hours");
		
		TableViewerColumn tableViewerColumn_3 = new TableViewerColumn(tableViewer, SWT.NONE);
		TableColumn tblclmnStatus = tableViewerColumn_3.getColumn();
		tblclmnStatus.setWidth(100);
		tblclmnStatus.setText("Status");
		
		TableViewerColumn tableViewerColumn_4 = new TableViewerColumn(tableViewer, SWT.NONE);
		TableColumn tblclmnDescription = tableViewerColumn_4.getColumn();
		tblclmnDescription.setWidth(100);
		tblclmnDescription.setText("Description");
		new DetailedUtilisationCompositeController(this);
		

	}

	@Override
	protected void checkSubclass() {
		
	}
	
	public TableViewer getTableViewer() {
		return tableViewer;
	}
}
